package com.yyq.reflection;

import com.yyq.reflection.annotation.DefaultNullStringValue;

/**
 * @Author yuanyueqiang
 * @Date 2021-11-28 23:44
 */
public class Car {

    @DefaultNullStringValue("volkswaggen")
    private String brand;
    private String color;
    private int price;

    private Car() {
    }

    public Car(String brand) {
        this.brand = brand;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public void drive(){
        System.out.println("开车!!!");
    }

    private String changeBrand(String brandPrefix){
        this.brand = brandPrefix +"-"+ this.brand;
        System.out.println("new brand:" + this.brand);
        return brand;
    }

    @Override
    public String toString() {
        return "Car{" +
                "brand='" + brand + '\'' +
                ", color='" + color + '\'' +
                ", price=" + price +
                '}';
    }
}
